Skip to main content

All Questions

Tagged with
0votes
2answers
91views

Adding up sizes of directories using bash is inconsistent

First, I got the total size of folder /my-downloads: $ du -sh /my-downloads 304G /my-downloads As you can see, it's 304G. Then, I wanted to find out the total size of all immediate directories ...
Logan Lee's user avatar
1vote
0answers
128views

Output of 2 commands get the difference (ls vs du)

So analyzing an issue at work I found that, when I created some datafiles on Oracle, the datafiles didn't reserve the space in the Filesystem, so I went to the sapdata filesystem where I put the ...
Agustin Repetto's user avatar
0votes
2answers
235views

display total and used GB with percentage in one line linux command

I am trying to get /dev/sda output in the following format. 20% (10 GB used out of 50 GB). I tried using: df -h /dev/sda3|awk 'NR==2'|awk '{print $5}' but it gives me the percentage. I tried using ...
Novice's user avatar
-3votes
2answers
829views

How to find disk usage more than 70% and display largest file in them

I have a problem, how to find disk usage more than 70%, can be found forwarded by finding the largest file in them, then displaying it? Please help me with the shell script, thanks for the attention.
Ruddi Sam's user avatar
1vote
2answers
858views

Printing the column names using the output of "df -h" (macOS)

I am trying to: Print the output of the command "df -h" (in macOS),but only with /dev/disk* as ouptut. I used the following command: df -h|awk -F"\t" '/\/[d-v]{3}\/[a-z]{4}[0-9]{1}[s-t]{1}[0-9]{1}/{...
swasti bhushan deb's user avatar
14votes
3answers
10kviews

sum all numbers from "du"

We want to calculate the first numbers that we get from du du -b /tmp/* 6 /tmp/216c6f99-6671-4865-b8bc-7205f5388752_resources 668669 /tmp/hadoop7887078727316788325.tmp 6 /tmp/hadoop-hdfs ...
yael's user avatar
  • 13.9k
0votes
1answer
120views

how to verify at least XG free space on /var

we have the following df -h output [root@trump var]# df -h | grep "/var" /dev/mapper/vg-lvm_var 101G 85G 17G 84% /var how to verify at least 10G free space on /var in bash/awk/perl one liner ...
yael's user avatar
  • 13.9k
-4votes
1answer
187views

grep and nawk order difference

Could you explain why grep->nawk doesn't work in this situation?
Lunartist's user avatar
1vote
3answers
14kviews

See disk consume info using 'df' command on AIX

I'm trying to get the fs that have high space consumed. I'm trying to do this using df command with -g flag (gigabyte view) and I can't obtain my expected value. df -g | sed 's/%//g'| awk '+$5>=75 ...
vicdeveloper's user avatar
3votes
1answer
4kviews

Get the percentage of usage for a mount point [duplicate]

[root@vmx ~]# df -h /appl/was | grep [0-9]% | awk '{ print $4 }' # => 53% [root@vmx ~]# df -h / | grep [0-9]% | awk '{ print $4 }' # -> 108G This is happening because in case of a long ...
Spike.WD's user avatar
1vote
1answer
1kviews

Compare two files for greater than value

I Have a request to alert usage of disk every 30 minutes, The thing is recent output should check old alert to avoid to send same alert again and again. #!/bin/bash #export maillist=mailxxx@gmail....
Tom's user avatar
  • 11
0votes
1answer
519views

I want to compare my awk result with a specific value by if condition

I have the result in below command. They are capacity of drives I want to compare to a threshold value. So I want to compare each line to a specific value. If greater then some condition follows. df -...
geekybuddy's user avatar
0votes
2answers
124views

Determine how many files from a sorted list will fill up a disk

This has me puzzled. I think it should be easy, but I must be missing something, as the results are not consistent. I am backing up a long list of files to multiple disks, using rsync, using a list ...
u628898's user avatar
3votes
1answer
251views

awk + how to perform OR in awk

by the following command I capture available size from df echo "$DF" | awk '$NF == "/var" { print $(NF-2) }' how to set the syntax if I want to set NF == "/var" or NF == "/" because I want to ...
yael's user avatar
  • 1,547
2votes
1answer
3kviews

How to add hostname, date, and fix disk size

I'm collecting disk usage data and want to add the date, time, and hostname to this command. How can I do it in this format: YYYY-MM-DD HH:MM:SS,HOSTNAME,DISK_USAGE_DATA Command I have so far: df -...
linguru772x's user avatar

153050per page
close